package summer_vacation.cullen.two10;

import java.util.Scanner;

/**
 * Created by Cullen on 2015/8/7.
 */
public class N13_14_15 {
    public static void main(String[] args) {
        System.out.println("请输入一个整数：");
        Scanner input=new Scanner(System.in);
        int a=input.nextInt();
        System.out.println(a+"的因子有：");
        for(int i=1;i<=a;i++){
            if (a%i==0){
                System.out.println(+i);
            }
        }
        System.out.println(a+"素数因子是：");
        for(int h=2;h<=a;h++) {
            if (a % h == 0 && isTure(h)) {
                System.out.println(h);
            }
        }
    }
    public static boolean isTure(int a){
        if( a <= 1 ) return false;
        for( int i=2; i<a; i++ ){
            if( a % i == 0 ) return false;
        }return true;
    }
}
